/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License Version
 *  3 as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
 *  USA.
 */

#ifndef MENUBUTTON_H
#define MENUBUTTON_H

#include <QGraphicsWidget>
#include "global.h"

O_PRIVATE_DECLARE(MenuButton);
class MenuButton : public QGraphicsWidget
{
    Q_OBJECT
public:
    MenuButton(const QPixmap &pixmap, QGraphicsItem *parent = 0);
    MenuButton(QAction* action, const QRectF& rect,  QGraphicsItem *parent = 0);
    virtual ~MenuButton();
    QRectF boundingRect() const;
    QPainterPath shape() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *);
    void setData(const QString& data);
signals:
    void pressed();
    void pressed(const QString&);
    void hover(const QString&);
    void leave(const QString&);

public slots:
protected:
    void mouse(QGraphicsSceneMouseEvent *);
    void mousePressEvent(QGraphicsSceneMouseEvent *);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *);

    void hoverMoveEvent ( QGraphicsSceneHoverEvent * event);
    void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event);
private:
    O_PRIVATE_DECLARE_MEMBER(MenuButton);
   // MenuButtonPrivate * const d_ptr;
    //Q_DECLARE_PRIVATE(MenuButton);
};

#endif // MENUBUTTON_H
